package com.bkhc.product.entity;

import com.bkhc.common.enu.IndentityEnum;
import com.bkhc.common.enu.PriceModeEnum;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

@Entity
@Data
@Table(name = "tbl_price_rule")
@EntityListeners(AuditingEntityListener.class)
public class PriceRule {
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Id
    private Integer id ;

    @Column(name = "product_code")
    private String productCode;

    @Column(name = "product_name")
    private String productName;

    @Column(name = "brand_code")
    private String brandCode;
    @Column(name = "indentity")
    private String indentity;

    private String indentityName;

    @Column(name = "relate_way")//3是固定值，如果为2是比率,1为厂商上传,0为加法规则
    private String  relateWay;

    @Column(name = "fix_price")
    private String fixPrice;

    @Column(name = "price_ratio")
    private BigDecimal rate;

    @Column(name ="relate_obj")
    private String relateObj;

    @Column(name = "remarks")
    private String remarks;

    @Column(name = "creator",updatable = false)
    private String creator;

    @Column(name = "create_date",updatable = false)
    @CreatedDate
    private Date createDate;

    @Column(name = "updator")
    private String updator;

    @LastModifiedDate
    @Column(name = "update_date")
    private Date updateDate;

}
